import { Component, OnInit } from '@angular/core';
import { I18nService } from '../../../core/i18n/i18n.service';
import { UserInfoService } from '../../../core/service';
import { Router } from '@angular/router';

@Component({
  selector: 'app-home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.scss']
})
export class HomeComponent implements OnInit {

  isLogin = false;
  username: string;

  constructor(
    private i18nService: I18nService,
    private userInfoService: UserInfoService,
    private router: Router
  ) { }

  toPage(url: string) {
    this.router.navigateByUrl(url);
  }

  changeLang(lang: string) {
    this.i18nService.changeLang(lang);
  }

  ngOnInit() {
    // const data = this.userInfoService.getUserInfo();
    // if (data) {
    //   this.isLogin = true;
    //   this.username = data.loginId;
    // } else {
    //   this.isLogin = false;
    // }
  }

}
